#FROM node:12.22-alpine
#FROM node:16.6.0-alpine3.14
# FROM node:12-slim
# NODE中依赖其它包 需要翻墙，所以找了一个 别人打好的 这个是基于 node 14.16.0 的
FROM buildkite/puppeteer:10.0.0
MAINTAINER datree "759666247@qq.com"

# 在日志中显示当前文件夹结构
RUN ls -al -R
# RUN mkdir -p /app/services
# WORKDIR /app/services
# COPY ./package.json /app/services/package.json
COPY ./src/index.js /index.js
#COPY ./google-chrome /opt/google/chrome/google-chrome
#RUN npm install
#RUN npm install puppeteer --unsafe-perm=true --allow-root
# RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
#     && mkdir -p /home/pptruser/Downloads \
#     && chown -R pptruser:pptruser /home/pptruser \
#     && chown -R pptruser:pptruser /node_modules

# USER pptruser
ENTRYPOINT ["node","/index.js"] 
CMD [ "--address=https://www.baidu.com" ]
# CMD 是 docker run 时运行的
# 定参
# ENTRYPOINT ["node","/app/services/src/index.js"] 
# 变参 这个参数可以在 docker run 时传进来
#CMD [ "http://desktop-v13d272:8081/front_server/index.html" ]

# 模拟 jenkins shell
# 拉取代码分支
# npm run build
# cp -r ./bin ./docker/
# cp -r ./node_modules/ ./docker/
# cp pm2.json ./docker/
# docker build -t datree/individual:latest -f ./Dockerfile ./